package com.songlanyun.modules.areafeature.controller.api;

import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.R;
import com.songlanyun.modules.account.controller.common.AbstractApiController;
import com.songlanyun.modules.areafeature.entity.GoodsAreaFeatureEntity;
import com.songlanyun.modules.areafeature.model.GoodsAreaFeatureDTO;
import com.songlanyun.modules.areafeature.model.GoodsAreaFeatureSlimVo;
import com.songlanyun.modules.areafeature.service.GoodsAreaFeatureService;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;
import java.util.Map;


/**
 * 商品特征分区
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2022-07-23 10:23:51
 */
@RestController
@RequestMapping("api/goodsareafeature")
public class ApiGoodsAreaFeatureController extends AbstractApiController {
    @Autowired
    private GoodsAreaFeatureService goodsAreaFeatureService;

    /**
     * 分页列表
     */
    @GetMapping("/page")
    public R page(@RequestParam Map<String, Object> params){
        PageUtils page = goodsAreaFeatureService.queryPage(params);
        return R.ok().put("page", page);
    }

    /**
     * 公益福购商品列表
     */
    @GetMapping("/welfarePage")
    public R welfarePage(@RequestParam Map<String, Object> params){
        PageUtils welfarePage = goodsAreaFeatureService.welfarePage(params);
        return R.ok().put("page", welfarePage);
    }


    /**
     * 列表
     */
    @GetMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        List<GoodsAreaFeatureSlimVo> list= goodsAreaFeatureService.queryList(params);
        return R.ok().put("data", list);
    }

}
